package com.my.mail2.model;

import com.my.mail2.service.IEmailService;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 * 邮件基础信息
 */
@Data
@NoArgsConstructor
public class Email2 implements Serializable {

    /**
     * 到达邮箱
     */
    private String toAddress;
    /**
     * 标题
     */
    private String subject;
    /**
     * 网页邮件
     */
    private String htmlBody;
    /**
     * 文字邮件
     */
    private String textBody;
    /**
     * 已处理服务
     */
    private Set<IEmailService> processedService = new HashSet<>();

    @Builder
    public Email2(String toAddress, String subject, String htmlBody, String textBody) {
        this.toAddress = toAddress;
        this.subject = subject;
        this.htmlBody = htmlBody;
        this.textBody = textBody;
    }
}
